//
//  ProductInfo.m
//  HWZB
//
//  Created by 许成雄 on 2017/5/7.
//  Copyright © 2017年 wonders. All rights reserved.
//

#import "ProductInfo.h"

@implementation ProductInfo

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
    return @{
             @"productId" : @"id",
             @"productName" : @"productName",
             @"productDesc" : @"productDisc",
             @"imageUrl" : @"image",
             @"imageUrl2" : @"image2",
             @"imageUrl3" : @"image3",
             @"imageUrl4" : @"image4",
             @"imageUrl5" : @"image5",
             @"order" : @"order",
             @"modelId" : @"modelId",
             @"refreshTime" : @"refreshTime"
             };
}

+ (NSValueTransformer *)productIdJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id value) {
        if([value isKindOfClass:[NSNumber class]]) {
            return [value stringValue];
        } else {
            return (NSString *)value;
        }
    }];
}

+ (NSValueTransformer *)modelIdJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id value) {
        if([value isKindOfClass:[NSNumber class]]) {
            return [value stringValue];
        } else {
            return (NSString *)value;
        }
    }];
}


@end
